﻿<!DOCTYPE html>
<html lang="en" dir="ltr">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection" content="telephone=no" />
    <title>欢迎语设置</title>
    <link rel="stylesheet" type="text/css" href="../plugins/weui/css/weui.min.css">
    <link rel="stylesheet" type="text/css" href="../css/base.css">
    <link rel="stylesheet" type="text/css" href="../css/css.css">

    <style>
        .text-area {
            height: 130px;
            width: 100%;
            background-color: white;
            padding-top: 20px;
        }

        .welcome_tarea {
            height: 100%;
            width: 80%;
            border: none;
            font-size: 20px;
            margin-left: 10%;
        }

        .btn {
            margin-top: 40px;
            width: 90%;
            background-color: #FF8427;
            margin-bottom: 20px;
        }

        .result-mu {
            position: absolute;
            height: 100%;
            width: 100%;
            background-color: black;
            opacity: 0.2;
            padding: 10px 0px 20px 0px;
        }

        .result {
            text-align: center;
            position: relative;
        }

        .result-info {
            height: 130px;
            width: 60%;
            margin: auto;
            color: black;
            text-align: left;
            position: absolute;
            top: 10px;
            left: 50%;
            margin-left: -30%;
            word-break: break-all;
            word-wrap: break-word;
            overflow: hidden;
            font-size: 16px;
            padding-left: 10px;
        }

        .result-infos {
            height: auto;
            width: 240px;
            margin: 0 auto;
            border-radius:5px 5px 0px 0px;
            background-color: white;
            color: #5F5F5F;
            text-align: left;
            word-break: break-all;
            word-wrap: break-word;
            overflow: hidden;
            font-size: 16px;
        }

        .result-infoss {
            margin: 0 auto;
            width: 100%;
        }

        .result-img {
            width: 90%;
            margin-top: 20px;
        }

        .xiaoguo {
            height: 40px;
            width: 90%;
            color: #A09FA4;
            padding-left: 10px;
            font-size: 16px;
        }

        .imgpng {
            background: url(../images/pk/1223.png);
            width: 292px;
            height: 424px;
            object-fit: cover;
            background-position: -70px -120px;
            margin: 0 auto;
        }

        .boosimg {
            width: 40px;
            height: 40px;
            position: relative;
            left: 10px;
            top: 10px;
        }
    </style>
</head>
<body>
  <div class="container">
    <div class="text-area">
      <textarea class="welcome_tarea" id="wel" cols="70" maxlength="200" name="name" style="resize:none" onkeyup="changeContent()"></textarea>
    </div>
    <a href="javascript:;" class="weui-btn btn" style="color:white;">保存</a>
    <div class="xiaoguo">
    效果图
    </div>
    <div class="result">
      <!--<div class="result-mu">
      </div>-->
        <div class="result-infoss">
            <div class="boosimg ">
                <img src="" width="100%" height="100%" />
            </div>
            
            <div class="result-infos">

            </div>
        </div>
      <!--<img src="../images/pk/1223.png" alt="" class="result-img">-->
        <div class="imgpng">
        </div>

    </div>
  </div>

    
<script src="../js/jquery-2.1.4.min.js"></script>
<script src="../js/base.js"></script>
  <script type="text/javascript">
  	$(function () {
  	    load();
  	    loadStaff();
  		$('.weui-btn').click(function () { submits() })
  	})

  	function load() {
  		ajaxGet(siteApiList.GetWelcomeTip + "?staffId=" + staffId, function (data) {
  			if (!isJsonSuccess(data))
  				return;
  			if (data.Data == null || data.Data.Value == null)
  				return;
  			$('#wel').val(data.Data.Value)
  			changeContent()
  		})
  	}
  	function submits() {
  		var content = $('#wel').val();
  		ajaxPost(siteApiList.SetWelcomeTip, "staffId=" + staffId + "&content=" + content, function (data) {
  			console.log(data);
  			if (!isJsonSuccess(data))
  				return;
  			Alert("保存成功");
  		})
  	}

    function changeContent() {
    	$('.result-infos').html($('#wel').val());
    }
    function loadStaff() {
        ajaxGet(siteApiList.GetInfo + "?id=" + staffId, function (data) {
            if (!isJsonSuccess(data))
                return;
            var item = data.Data;
            $(".boosimg > img").attr("src", siteConfig.formatAvater(item.Avater));
        });
    }
  </script>
</body>

</html>
